import cv2 as cv
import numpy as np

image = cv.imread("res.jpg", 0)

Sobelx = cv.Sobel(image, cv.CV_64F, 1, 0)
Sobelx = cv.convertScaleAbs(Sobelx)

Sobely = cv.Sobel(image, cv.CV_64F, 0, 1)
Sobely = cv.convertScaleAbs(Sobely)

Sobelxy = cv.Sobel(image, cv.CV_64F, 1, 1)
Sobelxy = cv.convertScaleAbs(Sobelxy)

Sobelxy_my = cv.addWeighted(Sobelx, 0.5, Sobely, 0.3, 0)

res = np.hstack((image, cv.imread("res.jpg", 0), image, image, image))
cv.imshow('res', res)

cv.waitKey()
cv.destroyAllWindows()
